#include "q_shared.h"
#include "bg_global.h"
#include "bg_gamex86funcs.h"
#include "g_local.h"

//Reroutes global calls
void HookGIFuncs( void )
{
	ClientCommandX = (gamex86ClientCommand)globals->ClientCommand;
	ShutdownGameX = (gamex86ShutdownGame)globals->Shutdown;
	globals->ClientCommand = (gamex86ClientCommand)ClientCommand;
	globals->Shutdown = (gamex86ShutdownGame)ShutdownGame;
	delayedShutdown = (int *)DLLA(0x20582DA0, jagamex86);
	level_time = (int *)DLLA(0x201F4E64, jagamex86);
	InitItems();
	HookSpawningFuncs();

	//Get our cvars going
	g_spskill = (cvar_t *)DLLA(0x201F4B60, jagamex86);
	g_subtitles = (cvar_t *)DLLA(0x201F4B14, jagamex86);
}